package com.jrauto.CarAppBackend.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jrauto.CarAppBackend.entity.CarMedia;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author huimin
* @description 针对表【car_media(车辆图片和视频)】的数据库操作Mapper
* @createDate 2025-07-02 14:10:41
* @Entity generator.domain.CarMedia
*/
@Mapper
public interface CarMediaMapper extends BaseMapper<CarMedia> {
    /**
     * 根据车辆ID查询所有媒体信息
     * @param carId 车辆ID
     * @return 媒体列表
     */
    @Select("SELECT * FROM car_media WHERE car_id = #{carId} ORDER BY order_index ASC")
    List<CarMedia> selectMediaByCarId(Integer carId);
}




